package com.newsmanagement.controller.user;


import com.newsmanagement.domain.pojo.NodeInfo;
import com.newsmanagement.mapper.SlauNodeInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/nodeInfo")
public class SlauNodeInfoController {

    @Autowired
    private SlauNodeInfoMapper slauNodeInfoMapper;

    /**
     * 获取所有养殖企业列表（type=1）
     */
    @GetMapping("/farmCompanies")
    public List<NodeInfo> getFarmCompanies() {
        return slauNodeInfoMapper.selectFarmCompanies();
    }

    /**
     * 获取所有屠宰企业列表（type=2）
     */
    @GetMapping("/slauCompanies")
    public List<NodeInfo> getSlauCompanies() {
        return slauNodeInfoMapper.selectSlauCompanies();
    }
}